package com.wanghlme.bookstore.bean;

import com.wanghlme.bookstore.entity.Book;

public class CartItem {

    private Book book;
    private Integer count;
    private Double price;

    public CartItem() {
    }

    public CartItem(Book book, Integer count, Double price) {
        this.book = book;
        this.count = count;
        this.price = price;
    }

    public Book getBook() {
        return book;
    }

    public void setBook(Book book) {
        this.book = book;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(double price, int count) {
        this.price = price * count;
    }

    @Override
    public String toString() {
        return "CartItem{" +
                "book=" + book +
                ", count=" + count +
                ", price=" + price +
                '}';
    }
}
